import { Body, Controller, Post, UseGuards } from '@nestjs/common'

import { AuthLoginDTO, AuthRegisterDTO } from './auth.dto'
import { AuthService } from './auth.service'
import { LocalAuthGuard } from './local.auth.guard'

@Controller('auth')
export class AuthController {
  constructor(private readonly authServe: AuthService) {}
  @Post('signUp')
  public signUp() {
    // const token = this.userService.signUp(data);
    // return token;
  }

  @Post('register')
  public register(@Body() body: AuthRegisterDTO) {
    return this.authServe.register(body)
  }

  @UseGuards(LocalAuthGuard)
  @Post('signIn')
  public signIn(@Body() body: AuthLoginDTO) {
    const token = this.authServe.signIn(body)
    return token
  }
}
